From 985b0e57b25f2db06f94ae941d65766079a2a703 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 13 Jan 2011 23:40:47 -0500 Subject: [PATCH] Add a migration guide section about multiple backends --- docs/reference/gtk/migrating-2to3.xml | 43 +++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/docs/reference/gtk/migrating-2to3.xml b/docs/reference/gtk/migrating-2to3.xml index d9bb6a3c31..6022ce7a1b 100644 --- a/docs/reference/gtk/migrating-2to3.xml +++ b/docs/reference/gtk/migrating-2to3.xml @@ -746,6 +746,49 @@ on_alpha_screen_changed (GtkWindow *window, +
+ Backend-specific code + + In GTK+ 2.x, GDK could only be compiled for one backend at a time, + and the %GDK_WINDOWING_X11 or %GDK_WINDOWING_WIN32 macros could + be used to find out which one you are dealing with: + +#ifdef GDK_WINDOWING_X11 + if (timestamp != GDK_CURRENT_TIME) + gdk_x11_window_set_user_time (gdk_window, timestamp); +#endif +#ifdef GDK_WINDOWING_WIN32 + /* ... win32 specific code ... */ +#endif + + In GTK+ 3, GDK can be built with multiple backends, and currently + used backend has to be determined at runtime, typically using + type-check macros on a #GdkDisplay or #GdkWindow. You still need + to use the #GDK_WINDOWING macros to only compile code referring + to supported backends: + +#ifdef GDK_WINDOWING_X11 + if (GDK_IS_X11_DISPLAY (display)) + { + if (timestamp != GDK_CURRENT_TIME) + gdk_x11_window_set_user_time (gdk_window, timestamp); + } + else +#endif +#ifdef GDK_WINDOWING_WIN32 + if (GDK_IS_WIN32_DISPLAY (display)) + { + /* ... win32 specific code ... */ + } + else +#endif + { + g_warning ("Unsupported GDK backend"); + } + + +
+
The GtkWidget::draw signal -- 2.30.2